<div class="card-box">
    <!-- Row start -->
    <div class="am-g">
        <div class="am-u-sm-12 am-u-md-6">
            <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                    <a class="am-btn am-btn-default" href="/depot/add"><span class="am-icon-plus"></span> 新增</a>
                </div>
            </div>
        </div>

        <div class="am-u-sm-12 am-u-md-3">
            <div class="am-input-group am-input-group-sm">
                <input type="text" class="am-form-field">
                <span class="am-input-group-btn">
				            <button class="am-btn am-btn-default" type="button">搜索</button>
				          </span>
            </div>
        </div>
    </div>
    <!-- Row end -->

    <!-- Row start -->
    <div class="am-g">
        <div class="am-u-sm-12">
                <table class="am-table am-table-striped am-table-hover table-main">
                    <thead>
                        <tr>
                            <th class="table-check"><input type="checkbox" /></th>
                            <th class="table-id">ID</th>
                            <th class="table-title">仓库名称</th>
                            <th class="table-type">添加时间</th>
                            <th class="table-set">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {{range .ol}}
                        <tr>
                            <td><input type="checkbox" /></td>
                            <td>{{.Id}}</td>
                            <td>{{.Name}}</td>
                            <td class="am-hide-sm-only">{{timetodateint .Ctime}}</td>
                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only delete-id" id="{{.Id}}" ><span class="am-icon-trash-o"></span> 删除</button>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        {{end}}
                    </tbody>
                </table>
                <hr />
                <p>注：<span style="color:red">请删除分类之前进行确认</span></p>
        </div>

    </div>
    <!-- Row end -->

</div>
</div>
</div>

<script>

        //禁用 启用  用户
        $(".disuser-id").click(function () {
            if (confirm("确定禁用当前用户？")) {
                var id = $(this).attr("id")
                var st = $(this).attr("statusid")
                $.get("/user/disuser", { id: id, st: st }, function (data) {
                    if (data.status == 1) {
                        alert(data.msg)
                        window.location.reload()
                    } else {
                        alert(data.msg)
                    }
                },"json")
            }
        });

         //删除
        $(".delete-id").click(function () {
            if (confirm("确定删除当前用户？")) {
                var id = $(this).attr("id")
                $.get("/depot/delete", { id: id}, function (data) {
                    if (data.status == 1) {
                        alert(data.msg)
                        window.location.reload()
                    } else {
                        alert(data.msg)
                    }
                },"json")
            }
        });


</script>